<?php
if (!defined('DC_CONTEXT_ADMIN')) { return; }
 
$m_version = $core->plugins->moduleInfo('agendaPlugin','version');
 
$i_version = $core->getVersion('version');
 
if (version_compare($i_version,$m_version,'>=')) {
	return;
}
 
# Création du setting (s'il existe, il ne sera pas écrasé)
/*$settings = new dcSettings($core,null);
$settings->setNamespace('agendaPlugin');
$settings->put('toto_setting',true,'boolean','toto setting',false,true);
*/
$core->setVersion('agendaPlugin',$m_version);

// Creation de la table agendPlungin
	$s = new dbStruct($core->con,$core->prefix);
	$t = $s->table('agenda');
	$t->field('post_id','bigint',0,false);
	$t->field('date_debut','timestamp',0,true);
	$t->field('date_fin','timestamp',0,true);
	// Clé primaire :
	$t->reference('fk_post','post_id','post','post_id','cascade','cascade');
	$si = new dbStruct($core->con,$core->prefix);
	$changes = $si->synchronize($s);

?>
